package cn.serenedream.housedecoration.entity;

import jakarta.persistence.*;
import org.springframework.lang.Nullable;

import java.util.ArrayList;
import java.util.List;

@Entity
public class Products {
    @Id
    private Long id;

    @Nullable
    private String name;
    @Nullable
    private Double price;

    private String address;

    @OneToOne
    @JoinColumn(name = "model_id")
    private Model model;


    public Products() {
    }

    public Products(Long id, String name, Double price, String address, Model model) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.address = address;
        this.model = model;
    }

    /**
     * 获取
     * @return id
     */
    public Long getId() {
        return id;
    }

    /**
     * 设置
     * @param id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return price
     */
    public Double getPrice() {
        return price;
    }

    /**
     * 设置
     * @param price
     */
    public void setPrice(Double price) {
        this.price = price;
    }

    /**
     * 获取
     * @return address
     */
    public String getAddress() {
        return address;
    }

    /**
     * 设置
     * @param address
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * 获取
     * @return model
     */
    public Model getModel() {
        return model;
    }

    /**
     * 设置
     * @param model
     */
    public void setModel(Model model) {
        this.model = model;
    }

    public String toString() {
        return "Products{id = " + id + ", name = " + name + ", price = " + price + ", address = " + address + ", model = " + model + "}";
    }
}
